import request from '@/utils/request'

export function createTask(data) {
  return request({
    url: '/task/create',
    method: 'POST',
    data
  })
}

export function getTasks(params) {
  return request({
    url: '/tasks',
    method: 'GET',
    params
  })
}

export function getTask(id) {
  return request({
    url: `/task/${id}`,
    method: 'GET'
  })
}

export function updateTask(data) {
  return request({
    url: `/task/update`,
    method: 'PUT',
    data
  })
}

export function deleteTask(id) {
  return request({
    url: `/task/${id}`,
    method: 'DELETE'
  })
}
